# -*- codeing = utf-8 -*-
from bs4 import BeautifulSoup
import requests
#请求网址
def get_request(url):
    try:
        headers = {
            'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3877.400 QQBrowser/10.8.4506.400'
        }
        resp = requests.get(url=url,headers=headers)
        resp.encoding = 'UTF-8'
        soup = BeautifulSoup(resp.text,'lxml')
        print(soup)
        return soup
    except Exception as err:
        print("程序请求失败")


URL = 'http://www.ceic.ac.cn/speedsearch'
get_request(URL)